import { _decorator, Component, Node } from 'cc';
import NodeMap from '../NodeMap';
const { ccclass, property } = _decorator;

@ccclass('UIBase')
export class UIBase extends Component {

    
    public get UIName() : string {
        return this.node.name;
    }

    protected uiMap : NodeMap = new NodeMap();

    protected override onLoad(): void {
        //  查找所有被标记的子节点
        this.uiMap.SearchAllNode(this.node);
        //  调用初始化回调
        this.onInit();
    }

    /**
     * UIBase:初始化
     */
    public onInit(){

    }

    /**
     * 开启时调用
     */
    public onOpen(){

    }

    /**
     * UIBase:UI被关闭时调用
     */
    public onClose(){

    }
}


